package com.lcredu.springboot.furn.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;

@Data
@TableName
public class Furn {
    @TableId(type = IdType.AUTO)
    private Integer id;
    
    @NotBlank(message = "商品名称不能为空")
    private String name;
    
    @NotBlank(message = "制造商不能为空")
    private String maker;
    
    @NotNull(message = "价格不能为空")
    @PositiveOrZero(message = "价格必须大于等于0")
    private Double price;
    
    @NotNull(message = "销量不能为空")
    @PositiveOrZero(message = "销量必须大于等于0")
    private Integer sales;
    
    @NotNull(message = "库存不能为空")
    @PositiveOrZero(message = "库存必须大于等于0")
    private Integer stock;
}
